export const getAuthent = (key: string) => {
  try {
    if (window && window.localStorage) {
      return window.localStorage.getItem(key);
    } else {
      return uni.getStorageSync(key);
    }
  } catch (e) {
    console.warn(`获取缓存失败`, e);
  }
};

export const setAuthent = (key: string, value: string) => {
  try {
    if (window && window.localStorage) {
      return window.localStorage.setItem(key, value);
    } else {
      return uni.setStorageSync(key, value);
    }
  } catch (e) {
    console.warn(`存储缓存失败`, e);
  }
};
export const clearAuthent = () => {
  try {
    if (window && window.localStorage) {
      return window.localStorage.clear();
    } else {
      return uni.clearStorageSync();
    }
  } catch (e) {
    console.warn(`清空缓存失败`, e);
  }
};
